<template>
  <div class="container fy-flex">
    <div class="menu__icon menu-cell fy-flex fy-flex__center">
      <img src="../../assets/screen/btn_home.png"/>
    </div>
    <div class="menu__icon menu-cell fy-flex fy-flex__center">
      <img src="../../assets/screen/btn_news.png"/>
      <div v-show="a" class="commodity-sign-wrap"></div>
    </div>
    <div class="menu__control menu-cell fy-btn">控制台</div>
    <div class="menu__user menu-cell fy-flex" @click="clickUser">
      <img src="../../assets/screen/screen_user.png"/>
      <p>嘉善大队</p>
      <div></div>
    </div>
  </div>
</template>

<script>
export default {
  // 全局感知
  name: "",

  // 模板依赖
  components: {},
  filters: {},
  // 接口
  props: {},

  // 本地状态
  data() {
    return {
      a: true
    };
  },
  computed: {},
  // 事件
  watch: {},
  beforeCreate() {},
  created() {},
  beforeMount() {},
  mounted() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  // 非响应式的属性
  methods: {
    clickUser() {}
  }
};
</script>

<style lang="scss" scoped>
.container {
  width: 40vw;
  height: 10vh;
  padding-left: 3vw;
  box-sizing: border-box;
}
.menu-cell {
  float: left;
  margin-left: 1.5rem;
}
.menu__icon {
  position: relative;
  width: 2rem;
  height: 2rem;
  border: 0.1rem solid #cfe4e6;
  border-radius: 2rem;
  cursor: pointer;
  img {
    width: 1.3rem;
    height: 1.3rem;
  }
  &:active {
    opacity: 0.8;
  }
  div {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    width: 1rem;
    height: 1rem;
    border-radius: 1rem;
    background: red;
  }
}
.menu__control {
  padding: 0.5rem 1rem;
  color: white;
  background: #0f244a;
  border-radius: 0.5rem;
  cursor: pointer;
  &:hover {
    background: rgba(15, 36, 74, 0.7);
  }
  &:active {
    background: rgba(15, 36, 74, 0.9);
  }
}
.menu__user {
  cursor: pointer;
  img {
    width: 2rem;
    height: 2rem;
    border-radius: 2rem;
  }
  p {
    margin: 0 1rem;
    color: #cfe4e6;
  }
  div {
    margin-top: 0.5rem;
    position: relative;
    transition: transform 0.3s;
    width: 0;
    height: 0;
    border-width: 0.5rem 0.5rem 0;
    border-style: solid;
    border-color: #cfe4e6 transparent transparent;
  }
  &:hover {
    div {
      transform: rotate(90deg);
    }
  }
}

.commodity-sign-wrap {
  animation: blink 1s infinite;
  -webkit-animation: blink 1s infinite;
}
@keyframes blink {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 100;
  }
  100% {
    opacity: 0;
  }
}
@-webkit-keyframes blink {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 100;
  }
  100% {
    opacity: 0;
  }
}
</style>
